<cfsilent>
<!---
Copyright: (c) 2006 The MachBlog Authors
Authors: Matt Woodward (mpwoodward@gmail.com) & Peter J. Farrell (pjf@maestropublishing.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and 
limitations under the License.

$Id: entry.cfm 1071 2007-01-16 18:35:00Z pfarrell $

Notes:
--->
<cfset entry = event.getArg("entry") />
<cfset comments = entry.getComments() />
<cfset categories = entry.getCategories() />
<cfset trackbacks = entry.getTrackbacks() />
<cfset categoryNames = "" />
<cfset categoryIds = "" />

<cfloop index="i" from="1" to="#ArrayLen(categories)#" step="1">
	<cfset categoryIds = ListAppend(categoryIds, categories[i][1], ",") />
	<cfset categoryNames = ListAppend(categoryNames, categories[i][2], ",") />
</cfloop>
</cfsilent>
<cfoutput>
	<h2>#entry.getTitle()#</h2>
	
	<p>#getProperty("udfs").renderEntry(entry.getBody())#</p>
	
	<cfif entry.getMoreBody() NEQ "">
		<p>#getProperty("udfs").renderEntry(entry.getMoreBody())#</p>
	</cfif>
	
	<cfif entry.getPhoto() NEQ "">
		<img src="#getProperty('blogUrl')#/uploads/photos/#URLEncodedFormat(GetFileFromPath(entry.getPhoto()))#" />
	</cfif>
	
	<p>
		<cfif entry.getAllowComments() AND getProperty("allowComments")>
			<a href="javascript:doPopup('index.cfm?#getProperty('eventParameter')#=showComments&entryId=#entry.getEntryId()#', 600, 600, false);">
				#comments.RecordCount# 
				<cfif comments.RecordCount EQ 1>
					#getProperty("resourceBundleService").getResourceBundle().getResource("comment")#
					<cfelse>
						#getProperty("resourceBundleService").getResourceBundle().getResource("comments")#
				</cfif>
			</a>&nbsp;|&nbsp;
		</cfif>
		<cfif entry.getAllowTrackbacks() AND getProperty("allowTrackbacks")>
			<a href="javascript:doPopup('index.cfm?#getProperty('eventParameter')#=showTrackbacks&entryId=#entry.getEntryId()#', 600, 600, false);">
				#trackbacks.RecordCount#
				<cfif trackbacks.RecordCount EQ 1>
					#getProperty("resourceBundleService").getResourceBundle().getResource("trackback")#
					<cfelse>
						#getProperty("resourceBundleService").getResourceBundle().getResource("trackbacks")#
				</cfif>
			</a>&nbsp;|&nbsp;
		</cfif>
		<cfif entry.getEnclosure() NEQ "">
			<a href="#getProperty('blogUrl')#/uploads/enclosures/#URLEncodedFormat(GetFileFromPath(entry.getEnclosure()))#">
				#getProperty("resourceBundleService").getResourceBundle().getResource("downloadenclosure")#
			</a>&nbsp;(#entry.getEnclosureMimeType()# <cfif entry.getEnclosureSize() / 1000 LT 1000>#NumberFormat(entry.getEnclosureSize() / 1000, "999")# KB<cfelse>#NumberFormat(entry.getEnclosureSize() / 1000000, "999.99")# MB</cfif>)&nbsp;|&nbsp;
		</cfif>
		<cfif ListLen(categoryNames) GT 0>
			<cfloop index="i" from="1" to="#ListLen(categoryNames)#">
				<a href="index.cfm?#getProperty('eventParameter')#=showEntriesByCategory&amp;categoryId=#ListGetAt(categoryIds, i)#">
					#ListGetAt(categoryNames, i)#</a><cfif i LT ListLen(categoryNames)>, </cfif>
			</cfloop>&nbsp;|&nbsp;
		<cfelse>
			<span style="color:##999999;">(#getProperty("resourceBundleService").getResourceBundle().getResource("uncategorized")#)</span>&nbsp;|&nbsp;
		</cfif>
		<cfif getProperty("allowSendToFriend")>
			<a href="index.cfm?#getProperty('eventParameter')#=showSendEntryToFriend&entryId=#entry.getEntryId()#">
				#getProperty("resourceBundleService").getResourceBundle().getResource("send")#
			</a>
		</cfif>
		<br />
		#getProperty("resourceBundleService").getResourceBundle().getResource("posted")# 
		#getProperty("resourceBundleService").getLocaleUtils().i18nDateFormat(entry.getDtPosted(), 3)# 
		@ #getProperty("resourceBundleService").getLocaleUtils().i18nTimeFormat(entry.getDtPosted(), 3)# 
		#getProperty("resourceBundleService").getResourceBundle().getResource("by")# #entry.getAudit().getCreatedByName()#
	</p>

	<cfif comments.RecordCount GT 0>
		<table border="0" cellpadding="2" cellspacing="2" width="100%">
			<tr>
				<td><strong>#getProperty("resourceBundleService").getResourceBundle().getResource("comments")#</strong></td>
			</tr>
			<cfloop query="comments">
				<cfif is_active>
					<tr>
						<td>#comment#</td>
					</tr>
					<tr>
						<td style="border-bottom:1px solid ##dedede;">
							#getProperty("resourceBundleService").getResourceBundle().getResource("postedby")# 
							<cfif url NEQ ""><a href="#url#"></cfif>#name#<cfif url NEQ ""></a></cfif> 
							@ #getProperty("resourceBundleService").getLocaleUtils().i18nDateTimeFormat(dt_created, 3, 3)#
						</td>
					</tr>
				</cfif>
			</cfloop>
		</table>
	</cfif>
</cfoutput>
